home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software of the Month Club 1998 March
/
Software of the Month Club 1998 March.iso
/
pc
/
dos
/
lg
/
astreg
/
drivers.exe
/
POSTSCRI.PRG
< prev
next >
Wrap
Text File
|
1994-08-13
|
6KB
|
117 lines
FUNCTION postscri
PARAMETERS pc_todo,px_param1,px_param2,px_param3,px_param4,px_param5,px_param6,px_param7
PRIVATE lc_params,lc_str,ll_query,ll_toprint
lc_params = "pc_todo,px_param1,px_param2,px_param3,px_param4,px_param5,px_param6,px_param7"
lc_str = ""
ll_query = .F.
ll_toprint = .T.
pc_todo = UPPER(pc_todo)
IF pc_todo="QUERY"
ll_query = .T.
ll_toprint = .F.
IF PCOUNT()=1
RETURN .T.
ENDIF
pc_todo = UPPER(px_param1)
px_param1 = px_param2
px_param2 = px_param3
px_param3 = px_param4
px_param4 = px_param5
px_param5 = px_param6
px_param6 = px_param7
ENDIF
DO CASE
CASE pc_todo = "VMI"
lc_str = "/LPI "+;
LTRIM(STR(1440/px_param1,10,4))+" def "
CASE pc_todo = "ORIENTATION"
PRIVATE la_orients,ln_x
DECLARE la_orients[3,2]
la_orients[1,1] = "PORTRAIT"
la_orients[1,2] = "Port"
la_orients[2,1] = "LANDSCAPE"
la_orients[2,2] = "Land"
ln_x = 1
px_param1 = UPPER(px_param1)
DO WHILE TYPE("la_orients[ln_x,1]")='C'
IF la_orients[ln_x,1] = px_param1
EXIT
ENDIF
ln_x = ln_x + 1
ENDDO
IF TYPE("la_orients[ln_x,1]") = 'C'
lc_str = la_orients[ln_x,2]+" "
ENDIF
CASE pc_todo = "PSIZE"
PRIVATE la_psizes,ln_x
DECLARE la_psizes[5,2]
la_psizes[1,1] = "LETTER"
la_psizes[1,2] = "letter"
la_psizes[2,1] = "LEGAL"
la_psizes[2,2] = "legal"
la_psizes[3,1] = "A4"
la_psizes[3,2] = "a4"
la_psizes[4,1] = "B5"
la_psizes[4,2] = "b5"
ln_x = 1
px_param1 = UPPER(px_param1)
DO WHILE TYPE("la_psizes[ln_x,1]")='C'
IF la_psizes[ln_x,1] = px_param1
EXIT
ENDIF
ln_x = ln_x + 1
ENDDO
IF TYPE("la_psizes[ln_x,1]") = 'C'
lc_str = la_psizes[ln_x,2]+" "
ENDIF
CASE pc_todo = "TMARGIN"
PRIVATE lc_tmargin,lc_textlen
lc_tmargin = LTRIM(STR(px_param1/20))
lc_textlen = LTRIM(STR(_plength/6+;
IIF(_psize="A4",7,;
IIF(_psize="B5",35,0))/300,10,4))
lc_str = "/tpyoff "+lc_tmargin+ " def "
lc_str = lc_str + "/gpyoff "+lc_tmargin+ " def "
lc_str = lc_str + "/apyoff "+lc_tmargin+ " def "
lc_str = lc_str + "/PageHeight "+lc_textlen+" def "
lc_str = lc_str + "Home "
ENDCASE
IF ll_toprint
??? lc_str
ELSE
IF ll_query
px_param7 = px_param6
px_param6 = px_param5
px_param5 = px_param4
px_param4 = px_param3
px_param3 = px_param2
px_param2 = px_param1
ENDIF
ENDIF
RETURN .NOT. ISBLANK(lc_str)